±ÍÇÏ´Â ¼Õ´Ô À̽ʴϴÙ
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ
  
  µ¨¸¶´ç °ø½Ä ÀºÇà°èÁÂ
  ÇϳªÀºÇà 227-910235-83607
  ¿¹±ÝÁÖ ÀÌ»ó±¹(¿î¿µÁø)
ÇÁ·ÎÁ§Æ® °Ô½ÃÆÇ
ÅõÇ¥°Ô½ÃÆÇ
µ¨¸¶´ç¼Ò°³
±âÃʺÎÅÍ È°¿ë±îÁö! µ¨ÆÄÀÌ ±³À° - µ¥ºê±â¾î
°­ÁÂ, ÆÁ, Á¤º¸ °­ÁÂ, ÆÁ, Á¤º¸ ÀÔ´Ï´Ù.
±Û³»¿ë - °­ÁÂ, ÆÁ, Á¤º¸
 [°­ÁÂ] »ï°¢Çü ¶Ç´Â ´Ù°¢Çü ¹öÆ° ¸¸µé±â
±èÀ¯Áß
(¼Õ´Ô)
2001-06-15 ¿ÀÈÄ 1:29:53
Ä«Å×°í¸®: ÆÁ
7747ȸ Á¶È¸



÷ºÎÆÄÀÏ ´Ù¿î·Îµå
3_button.jpg
±âÁ¸ ¾÷´Ù¿î ¹öÆ°¿¡ »öÀ» ³Ö±â À§ÇØ À̸®Àú¸® ã¾Æ ´Ù³à º¸¾ÒÁö¸¸
¿øÇÏ´Â ±â´ÉÀ» ãÁö ¸øÇØ ÀÌ·¸°Ô Á÷Á¢ ¸¸µé°Ô µÇ¾ú³×¿ä.

Á¦¸ñ : »ï°¢Çü ¶Ç´Â ´Ù°¢Çü ¹öÆ° ¸¸µé±â

¹öÆ°À» ¸¸µå´Â ¹æ¹ýÀº ¸¹ÀÌ ÀÖ´Â°Í °°Àºµ¥ ¿øÇÏ´Â ±â´ÉÀ» ã±â°¡
½±Áö ¾Ê¾Æ ÀÌ·± »ç¶÷À» À§ÇØ °£´ÜÇÏ°Ô ³ª¸¶ Á¤¸®¸¦ ÇØ º¸¾Ò´Ù.

¿ì¼± ¾÷´Ù¿î¹öÆ°À» »ç¿ëÇϱâ À§ÇØ API¸¦ ã¾Æ¼­ ³»¿ëÀ» ¾Ë¾Æº¸´Ï

CresteWindow(UPDOWN_CLASS,NULL,WS_CHILD | WS_VISIBLE | USD_SETBUDDYINT
| UDS_ALIGRIGHT, 0,0,0,0hWnd, NULL,g_hInst,NULL);

¶ÇÇÑ

HWND CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
HWND hParent, int nID, HINSTANCE hInst, HWND hBuddy, int nUpper, int nLower, int nPos);

¿Í °°Àº ¾Ë ¼ö ¾ø´Â ³»¿ëÀ¸·Î °¡µæÇß´Ù

°á·Ð¸¸ ¸»ÇÏ¸é ±¸¼ºÀ̳ª ¸ð¾çµî¿¡ °üÇÑ ¼öÁ¤Àº °¡´ÉÇßÁö¸¸ »ö»ó¿¡ °üÇÑ ³»¿ë
Àº ¾ø¾ú´Ù.

ÀÌ·¸´Ù¸é Á¦°¡ ÇØ°á ÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀº 3°¡Áö·Î
1. ¾Æ¿¹ sdk·Î ¸¸µå¾î ¹ö¸°´Ù
-> ½Ç·Â°ú ½Ã°£»óÀ¸·Î ¾ÈµÊ

2. ÇÁ·Î±×·¥ÀÌ ½ÇÇà µÉ ¶§ À©µµ¿ì »ö»óÀº º¯°æ Çß´Ù ´Ù½Ã µ¹·Á ³õ´Â´Ù.
-> ³Ê¹« ½Ã°£ÀÌ ´À¸®°í °£´ÜÇÑ ±¸Çö¿¡ ³Ê¹« ¸¹Àº ¿¡³ÊÁö¸¦ ¾²´Â°Í °°´Ù.

3. Á÷Á¢ ¸¸µç´Ù.
-> ¹ºÁö ¸ð¸£Áö¸¸ °¡´ÉÇÒ°Í °°´Ù.

ÀÌ·¸°Ô Çؼ­ ´Ù½Ã APIÃ¥À» ÀÐ¾î º¸°í ´Ù¸¥ »ç¶÷ÀÇ ÇÁ·Î±×·¥À» »ìÆì º¸¾Ò´Ù.
º.. ´«¿¡ È® ¶ç´Â ºÎºÐÀÌ ³ª¿Ô´Ù.

-¸®Àü
Ã¥ÀÇ ³»¿ëÀ» º¸ÀÚ¸é ´ÙÀ½°ú °°´Ù.
¸®Àü(region)À̶õ Áö¿ª,¿µ¿ª À̶õ ¶æÀÌ´Ù. WIN32¿¡¼­ ¸®ÀüÀº »ç°¢Çü, Ÿ¿øÇü, ´Ù°¢Çü
µîÀÇ °¢Á¾ µµÇüÀ¸·Î ±¸¼ºµÈ ¿µ¿ªÀ» ¸»ÇÑ´Ù. È­¸é»óÀÇ ÀÏÁ¤ÇÑ ¿µ¿ª¿¡ ´ëÇØ ÇÚµéÀ» ºÙÀÎ
°ÍÀÌ ¸®ÀüÀ̸ç ÀÏ´Ü ¸¸µé¾îÁö¸é ä¿ì±â, ±×¸®±â, ¹ÝÀü, È÷Æ® Å×½ºÆ® µî¿¡ ´Ù¾çÇÏ°Ô
»ç¿ëÇÒ ¼ö ÀÖ´Ù. ¸®ÀüÀº È­¸é»óÀÇ ÀÏÁ¤ ¿µ¿ª¿¡ ´ëÇÑ ¸ð¾ç°ú À§Ä¡¿¡ ´ëÇÑ Á¤º¸ÀÌ¸ç ³»
ºÎÀûÀΠ󸮿¡¸¸ »ç¿ëµÉ »ÓÀÌ´Ù. - ÀÌÇÏ »ý·«

À½... ¸®ÀüÀ» ÀÌ¿ëÇÏ¸é µÉ °Í °°´Ù´Â »ý°¢ÀÌ µé¾ú´Ù.
¸®ÀüÀº °¡Àå °£´ÜÇÏ°Ô »ç°¢Çü, Ÿ¿ø µîÀÇ ¸ð¾çÀ¸·Î ¸¸µé¾î Áö¸ç Á» ´õ º¹ÀâÇÏ°Ô ´Ù°¢Çü
À̳ª µÕ±Ù »ç°¢Çü µîÀÇ ¸ð¾çÀ¸·Î ¸¸µé¾î Áø´Ù. ¸®ÀüÀº ¸¸µå´Â ÇÔ¼ö´Â ´ÙÀ½°ú °°ÀÌ
¿©·¯°¡Áö°¡ ÀÖ´Ù.

HRGN CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
HRGN CreateRectRgnIndirect(CONST RECT *Iprc);
HRGN CreateRoundRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect,
int nWidthEllipse, int nHeightEllipse););
HRGN CreateEllipticRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
HRGN CreateElliptictRgnIndirect(CONST RECT *Iprc);
HRGN CreatePolygonRgn(CONST POINT *Ippt, int cPoints, int fnPolyFillMode);
HRGN CreatePolyPolygonRgn(CONST POINT *Ippt, CONST INT *IpPolyCounts,
int cCount, int fnPolyFillMode);

À§ À̸§¸¸À¸·Îµµ ÁüÀÛÇÒ ¼ö ÀÖ°ÚÁö¸¸
¿µ¿ªÀ» »ç°¢Çü, ¿ø, ´Ù°¢Çü µîÀ¸·Î ÇÒ ¼ö ÀÖ´Ù´Â ¶æ ÀÌ´Ù.

±âÁ¸¿¡ ¹öÆ° ¸»°í »ï°¢Çü, º°, ±âŸ ´Ù°¢Çü ¹öÆ°À» ¸¸µé±â À§Çؼ­´Â À§ÀÇ ÇÔ¼öÁß
HRGN CreatePolygonRgn(CONST POINT *Ippt, int cPoints, int fnPolyFillMode);
HRGN CreatePolyPolygonRgn(CONST POINT *Ippt, CONST INT *IpPolyCounts,
int cCount, int fnPolyFillMode);
À» ¾²¸é µÈ´Ù´Â °ÍÀÌ´Ù.

¶ÇÇÑ ¸®ÀüÀº µÎ°³ ÀÌ»óÀÇ ¸®ÀüÀ» °áÇÕÇÏ¿© »ç¿ë ÇÒ ¼ö µµ ÀÖ´Ù. ÀÌ·± ÀÚ¼¼ÇÑ ³»¿ëÀº
Á÷Á¢ Ã¥À» º¸½Ã¸é ¾Ë°ÍÀÌ°í ÀÌÁ¦ »ï°¢Çü ¹öÆ°À» ¸¸µé¾î º¸ÀÚ

´ÙÀ½Àº ³»°¡ ¸¸µé¾ú´ø ¹öÆ°ÀÇ ¼Ò½ºÀÌ´Ù. ¿ÏÀüÈ÷ ´Ù ±¸ÇöµÈ°ÍÀº ¾Æ´Ï°í
ÁÂ¿ì »ï°¢Çü¸¸ ¸¸µç°ÍÀÌ´Ù. ÇÊ¿ä¿¡ µû¶ó ±â´ÉÀ» ÷°¡ ÇÏ¿© »ç¿ëÇϸé ÀÌ»ÚÁö´Â ¾ÊÁö
¸¸ ´ë°­ÀÇ ¸ð½ÀÀº ±¸Çö ÇÒ ¼ö ÀÖÀ» °ÍÀÌ´Ù.

¸¸µé°í ³ª¼­ ´À³¤°ÍÀε¥ ÀÌ»óÇÏ°Ô À©µµ¿ì³ª µ¨ÆÄÀÌ¿¡¼­ Á¦°øÇÏ´Â ¾÷´Ù¿î ¹öÆ°ÀÇ ³»ºÎ
»ï°¢ÇüÀº Å©±â°¡ º¯Çصµ ¼±ÀÇ Ã³¸®°¡ ±ò²ûÇÏ°Ô Àß µÇ¾î ÀÖ´øµ¥ ÇÁ·Î±×·¥»óÀ¸·Î ¸¸µç
¹öÆ°Àº ¼±ÀÇ Ã³¸®°¡ ±ò²ûÇÏÁö ¾Ê¾Ò´Ù. ÀÌÀ¯´Â Àß ¸ð¸£°Ú´Âµ¥ ¾î·µç ÇÊ¿äÇÑ »ç¶÷ÀÌ
ÀÖÀ¸¸é Àß »ç¿ëÇϱ⠹ٶõ´Ù.

 
{ 
******************************************************* 
ÇÁ·Î±×·¥¸í : ÁÂ¿ì ¾÷´Ù¿î¹öÆ° 
Á¦ÀÛÀÏ : 2001.6.4 
Á¦ÀÛÀÚ : ±èÀ¯Áß 
»ç¿ë¹ý : ¾Ë¾Æ¼­ »ç¿ëÇÒ°Í 
******************************************************* 
} 
 
unit arbutton; 
 
interface 
 
uses 
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, 
Forms, Dialogs; 
 
type 
TButtonDirection = (arV, arH); //¹öÆ°¸ð¾ç ¼³Á¤(Á¿ì,»óÇÏ) --»óÇÏ´Â ¸¸µéÁö ¾ÊÀ½ 
TButtonDown = (btNone, btLeft, btRight); //¹öÆ°ÀÌ ´­·¯Á³À»°æ¿ì ¾î´À¹öÆ°ÀÌ ´©·È´ÂÁö ³ªÅ¸³¿ 
TButtonClickEvent = procedure (Sender: TObject; Button: TButtonDown) of object
 
TArButton = class(TGraphicControl) 
private 
fDirection: TButtonDirection; //¹öÆ°¸ð¾ç 
fButtonColor: TColor; //¹ÙÅÁ»ö¼³Á¤ 
fButtonDownColor: TColor; //´­·ÈÀ»°æ¿ì »ö»ó 
fButtonDown: Boolean; //´­·È³ª ¾È´­·È³ª 
fButtonDowntype : TButtonDown; //´­·ÈÀ¸¸é ¾î¶²³ðÀΰ¡ 
fButtonClick : TButtonClickEvent; //Ŭ¸¯À̺¥Æ®·Î º¸³¿ 
fButtonGap : Integer; //µÎ°³¹öÆ°»çÀÌÀÇ °£°Ý 
fButtonMag : Integer; //¹öÆ°±×¸±¶§ÀÇ ¸¶Áø 
fPnts1: array[1..3] of TPoint; //»ï°¢Çü(ÁÂ)ÀÇ ²ÀÁöÁ¡3°³ 
fPnts2: array[1..3] of TPoint; //»ï°¢Çü(¿ì)ÀÇ ²ÀÁöÁ¡3°³ 
fRgn1: HRgn; //¹öÆ°ÀÇ Å¬¸¯¿µ¿ª Á 
fRgn2: HRgn; //¹öÆ°ÀÇ Å¬¸¯¿µ¿ª ¿ì 
 
procedure SetDirection(value: TButtonDirection); 
procedure SetButtonColor(value: TColor); 
procedure SetButtonDownColor(value: TColor); 
procedure SetButtonGap(value: Integer); 
procedure SetButtonMag(value: Integer); 
procedure FreeRegion1; 
procedure FreeRegion2; 
protected 
procedure Paint; override
procedure DrawButton; 
procedure WMLButtonDown(var Message: TWMLButtonDown); //¸¶¿ì½º¸¦ ´©·ç¸é ´Ù¸¥»ö»óÇ¥½Ã 
message WM_LBUTTONDOWN; 
procedure WMLButtonUp(var Message: TWMLButtonUp); //¸¶¿ì½º¸¦ ³õ¾ÒÀ»°æ¿ì »ö»óº¹±Í 
message WM_LBUTTONUP; 
public 
constructor Create(AOwner: TComponent); override
destructor Destroy; override
 
published 
procedure Click(Button: TButtonDown); reintroduce; dynamic
 
property ButtonColor: TColor read fButtonColor write SetButtonColor; 
property ButtonDownColor: TColor read fButtonDownColor write SetButtonDownColor; 
property ButtonGap: Integer read fButtonGap write SetButtonGap; 
property ButtonMag: Integer read fButtonMag write SetButtonMag; 
property Direction: TButtonDirection read fDi